﻿using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;
using System.Windows.Controls;
using System.Windows.Markup;
//using System.Diagnostics;

namespace WpfAlarmTimer.Resources
{
    public class Resources : MarkupExtension
    {
        [ConstructorArgument("r")]
        public string r { get; set; }

        public Resources()
            : base()
        {
            
        }
        public override object ProvideValue(IServiceProvider serviceProvider)
        {
            if (r != null)
            {
                return Type.GetType("WpfAlarmTimer.Resources." + r).GetConstructor(new Type[] { }).Invoke(new object[] { });
            }
            else
            {
                return null;
            }

        }
    }

}
